package org.jeecg.modules.quartz.job;

import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.quartz.service.ICarService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 车辆模块定时任务
 */
@Slf4j
public class CarDonateTaskJob implements Job {
    @Autowired
    private ICarService carService;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        // 0 59 23 L * ?
        log.info(DateUtils.now()+":开始调用清除赠送金额任务");
        carService.clearDonateAmount();
        log.info("结束清除赠送金额任务");

        log.info(DateUtils.now()+":开始调用赠送金额任务");
        carService.refreshExpiredDerate();
        log.info("结束开始调用赠送金额任务");
    }
}
